package com.codedancer.campus.manager.api.lostFoundItem;

import com.codedancer.campus.common.anno.InterfacePermission;
import com.codedancer.campus.common.core.BaseApi;
import com.codedancer.campus.common.response.ApiResponse;
import com.codedancer.campus.manager.service.ILostFoundItemExamineRecordService;
import com.codedancer.campus.manager.service.vo.lostFoundItem.LostFoundItemExamineRecordVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/lost-found-item-examine-record")
@CrossOrigin(methods = {RequestMethod.GET, RequestMethod.POST, RequestMethod.DELETE,
    RequestMethod.PUT}, maxAge = 3600)
@Api(value = "失物招领审核记录Api", description = "失物招领审核记录Api", tags = "失物招领审核记录Api")
public class LostFoundItemExamineRecordApi extends BaseApi {

    @Autowired
    private ILostFoundItemExamineRecordService lostFoundItemExamineRecordService;

    @GetMapping("/list/{lostFoundItemUuid}")
    @ApiOperation("查询失物招领审核记录")
    @InterfacePermission(encodes = {"superAdmin","lostFoundItemAdmin"})
    public ApiResponse<List<LostFoundItemExamineRecordVo>> list(
        @PathVariable(value = "lostFoundItemUuid", required = true) @ApiParam(value = "物品uuid", required = true) String lostFoundItemUuid) {
        return success(
            lostFoundItemExamineRecordService.list(lostFoundItemUuid));
    }
}
